package com.fenghongzhang.mvp_lib.presenter;

import com.fenghongzhang.mvp_lib.model.IModel;
import com.fenghongzhang.mvp_lib.view.IView;

import javax.inject.Inject;

public class BasePresenter<M extends IModel,V extends IView> implements IPresenter {

    protected M mModel;
    protected V mView;

    @Inject
    public BasePresenter(M mModel, V mView) {
        this.mModel = mModel;
        this.mView = mView;
    }

    //1
    @Override
    public void destroy() {
        if(mModel != null){
            mModel.destroy();
            mModel = null;
        }
        if(mView != null){
            mView = null;
        }
    }
}
